package com.example.designprinciple.lsp;

/**
 * @Authors：gaoyang
 * @CreateTime：2021-10-20
 * @Description：todo
 */
public class LSPTest {

    public static void resize(Rectangle rectangle){
        while (rectangle.getWidth()>=rectangle.getHeight()){
            rectangle.setHeight(rectangle.getHeight()+1);
            System.out.println(rectangle.toString());
        }
    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.setHeight(10);
        rectangle.setWidth(20);
        resize(rectangle);
    }
}
